<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui">
<ui:composition>
	<div id="changepwdPageid">

		<h:form prependId="false">
			<h1>#{msgs.ChangePwd}</h1>
			<h:panelGrid columns="2" styleClass="profileTable">
				<h:outputLabel value="#{msgs.userid}"></h:outputLabel>
				<h:outputText value="#{userBackingBean.basicUser.userId}">
				</h:outputText>

				<h:outputLabel value="#{msgs.oldpassword}"></h:outputLabel>
				<h:panelGroup>
					<p:password id="oldPassword" value="#{viewScope.oldPassword}" feedback="false" validator="#{userBackingBean.validateOldPassword}">
						<p:ajax update="passwordErrold" event="change" process="@this"></p:ajax>
					</p:password>
					<p:message id="passwordErrold" for="oldPassword"></p:message>
				</h:panelGroup>


				<h:outputLabel value="#{msgs.password}"></h:outputLabel>
				<h:panelGroup>
					<p:password id="password" value="#{userBackingBean.basicUser.password}" feedback="true">
						<p:ajax process="@this" update="passwordErr" event="valueChange"></p:ajax>
					</p:password>

					<p:message id="passwordErr" for="password"></p:message>
				</h:panelGroup>

				<h:outputLabel value="#{msgs.passwordagain}"></h:outputLabel>

				<h:panelGroup>
					<p:password id="passwordagain" value="#{userBackingBean.basicUser.passwordagain}" validator="#{userBackingBean.checkPasswordMatch}">
						<p:ajax process="password passwordagain" update="passwordagainErr" event="valueChange"></p:ajax>
					</p:password>

					<p:message id="passwordagainErr" for="passwordagain"></p:message>
				</h:panelGroup>

				<h:outputLabel value="" />
				<p:commandButton value="#{msgs.SAVE}" update="display" actionListener="#{userBackingBean.changePassword()}" process="@form"></p:commandButton>

				<f:facet name="footer">
					<h:outputText value="#{requestScope.CHANGE_PWD_RESULT}" id="display" styleClass="infoMessage">
					</h:outputText>
				</f:facet>
			</h:panelGrid>


		</h:form>

	</div>

</ui:composition>
</html>